﻿package net.jmp0.toast.entities.menu 
{
	import net.jmp0.toast.entities.bases.GameButton;
	import net.jmp0.toast.entities.effects.GameText;
	import punk.core.Spritemap;
	
	/**
	 * ...
	 * @author Thodd
	 */
	public class PasswordButton extends GameButton
	{
		
		private var passwordText:GameText = new GameText("PASSWORD", 200, 120, "kraboudja", 36, -300, true);
		
		
		//Marker sprites
		[Embed(source = '../../res/marker/marker_blue.png')] private var imgBlueMarker:Class;
		private var sprBlueMarker:Spritemap = FP.getSprite(imgBlueMarker, 211, 69, false, false, 0, 0, true);
		
		
		public function PasswordButton(x:int, y:int, callback:Function) {
			super(x, y, callback);
			
			//positioning the text above the "button" aka the marker
			passwordText.x = x+10;
			passwordText.y = y+20;
			FP.world.add(passwordText);
			
			//making the marker a little "deeper than the text above the button"
			this.depth = -290;
			this.sprite = sprBlueMarker;
			this.alpha = 0.6;
			
		}
		
		override public function update():void {
			super.update();
			if (mouseIsOverMe) {
				visible = true;
			}else {
				visible = false;
			}
		}
	}

}